﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace DotNet.Common.Kit
{
    public class HtmlDocHelper
    {
        string _headHtml="";
        string _footHtml="";

        public HtmlDocHelper(string headFile, string footFile)
        {
            StreamReader srHead = new StreamReader(headFile,System.Text.Encoding.Default);
            _headHtml=srHead.ReadToEnd();
            srHead.Close();

            StreamReader srFoot = new StreamReader(footFile,System.Text.Encoding.Default);
            _footHtml = srFoot.ReadToEnd();
            srFoot.Close();
        }

        public string HeadHtml
        {
            get { return _headHtml; }
        }

        public string FootHtml
        {
            get { return _footHtml;}
        }
        public string GetHtmlDoc(string content)
        {
            return _headHtml +"\r\n"+ content + _footHtml;
        }
        public string CreateImgDom(string src,string id,string alt,string style)
        {
            string img="<img id='"+id+"' src='"+src+"' alt='"+alt+"' style='"+style+"' />";
            return img+"\r\n";
        }

        public bool SetBodyContent(System.Windows.Forms.HtmlDocument htmlDoc, string bodyConten)
        {
            htmlDoc.Body.InnerHtml = bodyConten;
            return false;
        }
    }
}
